package scanner.com.scanner;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.haha.extend.EditText.UnderLineEditText;


import java.util.List;
import java.util.Map;
import java.util.Set;

import scanner.com.databases.DBHelper;
import scanner.com.entity.ContactEntity;
import scanner.com.entity.DatabasesEntity;

/**
 * Created by Administrator on 2016/6/13 0013.
 */
public class TestActivity extends AppCompatActivity{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        UnderLineEditText underLineEditText = (UnderLineEditText) findViewById(R.id.line_et);
        ContactEntity contactEntity = new ContactEntity("李二狗","13888888888");
        DatabasesEntity databasesEntity = new DatabasesEntity(DatabasesEntity.RECORD_TYPE.CONTACT,contactEntity, DatabasesEntity.RECORD_FROM.MAKE);
        DBHelper.getInstance(this).insertRecord(databasesEntity);

        List<DatabasesEntity> databasesEntityList = DBHelper.getInstance(this).getAllRecords();
        underLineEditText.append("\n");
        for(DatabasesEntity record : databasesEntityList){
            underLineEditText.append(record.toString()+"\n");
        }

//        SharedPreferences sharedPreferences = new SharedPreferences;
//        sharedPreferences.Editor.p

    }
}
